package com.zijie.hosptal.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> {
    private String code;
    private String message;
    private Object data;
    public static <T> Result<T> success(T data){
        return new Result<>("200","操作成功",data);
    }
    public static <T> Result<T> fail(T data){
        return new Result<>("500","操作失败",data);
    }

    public static <T> Result<T> success(){
        return new Result<>("200","操作成功",null);
    }
    public static <T> Result<T> success(String msg, T data){
        return new Result<>("500",msg,data);
    }
}
